package com.hundsun.documentripper.error;

import lombok.Data;

/**
 * Note：
 *
 * @author ：mengjw
 * @description：基础异常类
 * @date ：Created in 2021/1/26
 */
@Data
public class BaseException extends RuntimeException {

    private static final long serialVersionUID = -1884040116894836030L;

    private String returnCode = "-1";
    private String errorCode = "-1";
    private String errorMessage = "";

    public BaseException(String errorCode) {
        this.errorCode = errorCode;
        this.errorMessage = ErrorMessage.getMessage(errorCode);

    }

    public BaseException(String errorCode, String message) {
        this.errorCode = errorCode;
        this.errorMessage = message;
    }

    public String getMessage() {
        return "错误编码：" + errorCode + "，错误信息：" + errorMessage;
    }
}